package cn.kai.ums.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 
 * @TableName ums_class
 */
@TableName(value ="ums_class")
@Data
public class UmsClass implements Serializable {
    /**
     * 班级id自增长
     */
    @TableId(type = IdType.AUTO)
    private Integer classId;

    /**
     * 班级编号，由入学年份（2位）+所在专业编号（4位）+数字（2位）组成
     */
    private String classNo;

    /**
     * 班级名称
     */
    private String className;

    /**
     * 班级所在专业编号
     */
    private String classSpecialNo;

    /**
     * 班级成立时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date classCrearteTime;

    /**
     * 班级几年制
     */
    private Integer classYearsTime;

    /**
     * 班级辅导员名称
     */
    private String classTeacher;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UmsClass other = (UmsClass) that;
        return (this.getClassId() == null ? other.getClassId() == null : this.getClassId().equals(other.getClassId()))
            && (this.getClassNo() == null ? other.getClassNo() == null : this.getClassNo().equals(other.getClassNo()))
            && (this.getClassName() == null ? other.getClassName() == null : this.getClassName().equals(other.getClassName()))
            && (this.getClassSpecialNo() == null ? other.getClassSpecialNo() == null : this.getClassSpecialNo().equals(other.getClassSpecialNo()))
            && (this.getClassCrearteTime() == null ? other.getClassCrearteTime() == null : this.getClassCrearteTime().equals(other.getClassCrearteTime()))
            && (this.getClassYearsTime() == null ? other.getClassYearsTime() == null : this.getClassYearsTime().equals(other.getClassYearsTime()))
            && (this.getClassTeacher() == null ? other.getClassTeacher() == null : this.getClassTeacher().equals(other.getClassTeacher()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getClassId() == null) ? 0 : getClassId().hashCode());
        result = prime * result + ((getClassNo() == null) ? 0 : getClassNo().hashCode());
        result = prime * result + ((getClassName() == null) ? 0 : getClassName().hashCode());
        result = prime * result + ((getClassSpecialNo() == null) ? 0 : getClassSpecialNo().hashCode());
        result = prime * result + ((getClassCrearteTime() == null) ? 0 : getClassCrearteTime().hashCode());
        result = prime * result + ((getClassYearsTime() == null) ? 0 : getClassYearsTime().hashCode());
        result = prime * result + ((getClassTeacher() == null) ? 0 : getClassTeacher().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", classId=").append(classId);
        sb.append(", classNo=").append(classNo);
        sb.append(", className=").append(className);
        sb.append(", classSpecialNo=").append(classSpecialNo);
        sb.append(", classCrearteTime=").append(classCrearteTime);
        sb.append(", classYearsTime=").append(classYearsTime);
        sb.append(", classTeacher=").append(classTeacher);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}